Database management systems (DBMS) maintain and manage data stored in databases. Management includes storing, deleting, retrieving and updating the data. Typically, data stored in a database includes plain values, e.g., numbers and alphanumeric strings, and complex objects such as images, documents and spatial data. The DBMS typically is hosted by a database server that is accessible by a plurality of client systems via a network.
In state of the art systems, the DBMS is capable of invoking executable code to manipulate the data in the database. In some systems, when instructed, the DBMS can automatically load and execute the code. Such executable code, known as an external routine, can be a stored procedure (STP) or a user defined function (UDF), which can be called within a statement or query from a client system. External routines are so named because they are not predefined and built into the DBMS. They can be defined by database users or applications.
Typically, external routines are stored in a shared library in a file system in a database server hosting the DBMS. The external routines are registered in a catalog maintained by the DBMS so that the DBMS can locate an external routine in the shared library. While this configuration is convenient, it presents a number of logistical challenges.
For instance, because the routines reside in the file system, inconsistencies between the file system and the catalog can arise, e.g., after a backup or restore function. A system administrator must ensure that any changes to the catalog are synchronized with the routines residing in the file system and vice versa. This is an added burden on the system administrator, and becomes particularly tedious if the database is partitioned over a plurality of nodes.
Moreover, because the routines reside in the file system, security concerns can arise. Typically, access to the file system is controlled by the server's operating system, while access to the database is controlled by the DBMS. The access control policies for the server are not necessarily identical to those of the DBMS, and therefore, a client who has access to the file system can inadvertently or intentionally modify, delete or replace a routine. This can cause serious system disruptions that require administrative attention. To prevent this, the system administrator has the added burden of controlling access to the file system and also protecting the external routines.